import { Ref } from "vue";

export default function OperationHook(state: { drawerOpts: Base.DrawerOpts; passData: Ref<Base.GeneraDataType> }) {
  const { drawerOpts, passData } = state;
  // 查看发票
  const showInvoiceHandle = () => {
    drawerOpts.width = "1200px";
    drawerOpts.title = "查看发票";
    drawerOpts.type = 1;
    drawerOpts.passData = { id: passData.value.id };
    drawerOpts.component = "ShowInvoice";
    drawerOpts.visible = true;
  };

  return {
    showInvoiceHandle
  };
}
